// jammit!
// output in C:\MyApps\jammit\MSC10.Debug.Debug_full.Gui.Mt
// IDE is Ultimate++ 1924 or greater
// Compiler is from Microsoft Studio 2010
// C:\Program Files\Microsoft Visual Studio 10.0\VC\bin
// OS is Windows 7
// Required one change in Core.h line 301: abs => abs64 to not collide with a stdlib function
 
/* Development History
  01/21/10
  Attempting to link in libwmp3.lib: failed
  Decided to go one level deeper to libmad 0.15.1b.  Built in VC6.0. ok.
  Links ok. http://www.underbit.com/products/mad/
  Docs: http://www.bsd-dk.dk/~elrond/audio/madlld/
  Trying to get madplay to work.
  - mad.h not found, switched to layer3.h
  - path to includes not found; fixed
  - FPM not set; setting compiler option to FPM_INTEL
  01/24/10
  Brought in libwmp3.lib.  Got it to work:  Just needed to set W_STATIC_LIB!  Doh!
  01/25/10
  Moving classes into main, since it has to maintain the thread connection in the background
  Runs great; got icons setup, task manager name ok, file properties ok
  02/03/10
  Windows remember their position using new class: PowerWindow, writes to XML config file.
  02/16/10
  Loads filelist in background, uses GridCtrl.  Play next automatically by editing libwpm3 to flag when Stop() was manually called.
  02/20/10
  Converted back to ArrayCtrl because GridCtrl crashes on Drag n Drop.  Fixed ArrayCtrl's flicker.
  Trying to fix DnD so that the target accepts drops in empty space below the grid.
*/
 
#include "MainWin.h"

// Custom Format formatters for commas, uppercase, trim, etc.
#include "formatters.h"
  
// Ultimate++ macro. Actually is "void GuiMainFn_"
// void GuiMainFn_();int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdShow) { Upp::Ctrl::InitWin32(hInstance); Upp::coreCmdLine__() = Upp::SplitCmdLine__(lpCmdLine); Upp::AppInitEnvironment__(); GuiMainFn_(); Upp::Ctrl::CloseTopCtrls(); Upp::UsrLog("---------- About to delete this log..."); Upp::DeleteUsrLog(); Upp::Ctrl::ExitWin32(); Upp::AppExit__(); return Upp::GetExitCode(); } void GuiMainFn_()
GUI_APP_MAIN
{

//	if(app.IsAnotherInstance())
//	{
//		HWND hwnd = GetAppHwnd("ultimateplayer.exe", true);
//		if(hwnd)
//		{
//			::PostMessage(hwnd, UM_FOREGROUND, 0, 0);
//			app.PassCmd(hwnd, UM_COMMANDLINE, CommandLine());
//		}
//		return;
//	}

	// Configure formatters for more readable text; not specific to mainWin so taken out of MainWin.h
	RegisterFormatters(); // in formatters.cpp

	MainWin *x = new MainWin();
	String arglist = Join(CommandLine(), " ");
	//x->Title("jammit");
	x->Run("jammit"); // Model view
	delete x;
	
	SetExitCode(4); // Avoid 1 and 0
}

/*
  Topics of interest:
  - Capture keys
  - Using simple SQL tool to store list of songs with infinite attributes.
*/


/*
  Issues with U++
  - Assemblies: Seems wrong to have to go to select main package to edit the packages
  - Assemblies: Would like to 
*/